<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>NeuZephyr: D:/Users/Mgepahmge/Documents/C Program/NeuZephyr/src/Model.cu Source File</title>
<link rel="icon" href="NZ_logo2.png" type="image/x-icon" />
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="NZ_logo2.png"/></td>
  <td id="projectalign">
   <div id="projectname">NeuZephyr
   </div>
   <div id="projectbrief">Simple DL Framework</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d522931ffa1371640980b621734a4381.html">Users</a></li><li class="navelem"><a class="el" href="dir_a7e6ee1ae3f772c9504a0b543f2027e2.html">Mgepahmge</a></li><li class="navelem"><a class="el" href="dir_e03f57e346cc4845a4c354a35630b169.html">Documents</a></li><li class="navelem"><a class="el" href="dir_231a0482af2b83c895f27ba7fe745141.html">C Program</a></li><li class="navelem"><a class="el" href="dir_0fa7fc3a0dfd304dbfc9dce9f6facfa2.html">NeuZephyr</a></li><li class="navelem"><a class="el" href="dir_25794e61537e3f33113e2168c9f8da60.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="headertitle"><div class="title">Model.cu</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="preprocessor">#include &quot;<a class="code" href="_model_8cuh.html">NeuZephyr/Model.cuh</a>&quot;</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><a class="code hl_function" href="classnz_1_1_model.html#abd63329d440cd96c832cbea7c7dfd133">nz::Model::Model</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span> </div>
<div class="foldopen" id="foldopen00005" data-start="{" data-end="}">
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#afaae0d794389dad645bc04558e1c3319">    5</a></span><a class="code hl_function" href="classnz_1_1_model.html#afaae0d794389dad645bc04558e1c3319">nz::Model::~Model</a>() {</div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span>    <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>* node : hiddenNodes) {</div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span>        <span class="keyword">delete</span> node;</div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span>    }</div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span>}</div>
</div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span> </div>
<div class="foldopen" id="foldopen00011" data-start="{" data-end="}">
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#ad061640ff58f4b09bc850019b27005a8">   11</a></span><a class="code hl_class" href="classnz_1_1data_1_1_tensor.html">Tensor</a>&amp; <a class="code hl_function" href="classnz_1_1_model.html#ad061640ff58f4b09bc850019b27005a8">nz::Model::forward</a>() {</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span>    computeGraph.forward();</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span>    <span class="keywordflow">return</span> *computeGraph.getOutputNode()-&gt;output;</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span>}</div>
</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span> </div>
<div class="foldopen" id="foldopen00016" data-start="{" data-end="}">
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#aded49f9b1c9be002bc81ee72dd4e08ac">   16</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1_model.html#aded49f9b1c9be002bc81ee72dd4e08ac">nz::Model::backward</a>() {</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span>    computeGraph.backward();</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span>}</div>
</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span> </div>
<div class="foldopen" id="foldopen00020" data-start="{" data-end="}">
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#a9060c98c30fb2388a9fd3ae9af67a046">   20</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1_model.html#a9060c98c30fb2388a9fd3ae9af67a046">nz::Model::update</a>(<a class="code hl_class" href="classnz_1_1opt_1_1_optimizer.html">opt::Optimizer</a>* optimizer)<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span>    computeGraph.update(optimizer);</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span>    computeGraph.<a class="code hl_function" href="classnz_1_1data_1_1_tensor.html#a6fed8efad540a7621dd6640b2f2466d0">zeroGrad</a>();</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span>}</div>
</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span> </div>
<div class="foldopen" id="foldopen00025" data-start="{" data-end="}">
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#ac9eb518cab0e5df54b986ca6f0233964">   25</a></span>Tensor::value_type <a class="code hl_function" href="classnz_1_1_model.html#ac9eb518cab0e5df54b986ca6f0233964">nz::Model::getLoss</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span>    <span class="keywordflow">return</span> computeGraph.getLoss();</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span>}</div>
</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span> </div>
<div class="foldopen" id="foldopen00029" data-start="{" data-end="}">
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#aaabce965b32aa9e32a961631dcdd6540">   29</a></span><a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* <a class="code hl_function" href="classnz_1_1_model.html#aaabce965b32aa9e32a961631dcdd6540">nz::Model::Add</a>(<a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* lhs, <a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* rhs) {</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span>    <span class="keywordflow">if</span> (!computeGraph.inGraph(lhs)) {</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span>        computeGraph.addNode(lhs);</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno">   32</span>    }</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno">   33</span>    <span class="keywordflow">if</span> (!computeGraph.inGraph(rhs)) {</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span>        computeGraph.addNode(rhs);</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span>    }</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span>    <span class="keyword">auto</span>* addNode = <span class="keyword">new</span> <a class="code hl_class" href="classnz_1_1nodes_1_1calc_1_1_add_node.html">calc::AddNode</a>(lhs, rhs);</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span>    hiddenNodes.push_back(addNode);</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span>    computeGraph.addNode(addNode);</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span>    <span class="keywordflow">return</span> addNode;</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span>}</div>
</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span> </div>
<div class="foldopen" id="foldopen00042" data-start="{" data-end="}">
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#a0ebe5c8d848f16af5d2a06592c3e2217">   42</a></span><a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* <a class="code hl_function" href="classnz_1_1_model.html#a0ebe5c8d848f16af5d2a06592c3e2217">nz::Model::Sub</a>(<a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* lhs, <a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* rhs) {</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span>    <span class="keywordflow">if</span> (!computeGraph.inGraph(lhs)) {</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span>        computeGraph.addNode(lhs);</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span>    }</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span>    <span class="keywordflow">if</span> (!computeGraph.inGraph(rhs)) {</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span>        computeGraph.addNode(rhs);</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span>    }</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span>    <span class="keyword">auto</span>* subNode = <span class="keyword">new</span> <a class="code hl_class" href="classnz_1_1nodes_1_1calc_1_1_sub_node.html">calc::SubNode</a>(lhs, rhs);</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno">   50</span>    hiddenNodes.push_back(subNode);</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span>    computeGraph.addNode(subNode);</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span>    <span class="keywordflow">return</span> subNode;</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span>}</div>
</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno">   54</span> </div>
<div class="foldopen" id="foldopen00055" data-start="{" data-end="}">
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#adcd0e6d5ec7e297bf50cd8bbe2077767">   55</a></span><a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* <a class="code hl_function" href="classnz_1_1_model.html#adcd0e6d5ec7e297bf50cd8bbe2077767">nz::Model::Mul</a>(<a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* lhs, <a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* rhs) {</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span>    <span class="keywordflow">if</span> (!computeGraph.inGraph(lhs)) {</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span>        computeGraph.addNode(lhs);</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span>    }</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span>    <span class="keywordflow">if</span> (!computeGraph.inGraph(rhs)) {</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span>        computeGraph.addNode(rhs);</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span>    }</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span>    <span class="keyword">auto</span>* mulNode = <span class="keyword">new</span> <a class="code hl_class" href="classnz_1_1nodes_1_1calc_1_1_mat_mul_node.html">calc::MatMulNode</a>(lhs, rhs);</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span>    hiddenNodes.push_back(mulNode);</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span>    computeGraph.addNode(mulNode);</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno">   65</span>    <span class="keywordflow">return</span> mulNode;</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno">   66</span>}</div>
</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno">   67</span> </div>
<div class="foldopen" id="foldopen00068" data-start="{" data-end="}">
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#af685ed9088799b290d5bd9d5b34cca95">   68</a></span><a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* <a class="code hl_function" href="classnz_1_1_model.html#af685ed9088799b290d5bd9d5b34cca95">nz::Model::Bias</a>(<a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* input) {</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno">   69</span>    <span class="keyword">auto</span>* param = <span class="keyword">new</span> <a class="code hl_class" href="classnz_1_1nodes_1_1io_1_1_input_node.html">io::InputNode</a>(</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span>        {1, input-&gt;output-&gt;shape()[1], input-&gt;output-&gt;shape()[2], input-&gt;output-&gt;shape()[3]}, <span class="keyword">true</span>);</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span>    param-&gt;output-&gt;randomize();</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span>    hiddenNodes.push_back(param);</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span>    computeGraph.addNode(param);</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span>    <span class="keywordflow">return</span> Add(input, param);</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno">   75</span>}</div>
</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno">   76</span> </div>
<div class="foldopen" id="foldopen00077" data-start="{" data-end="}">
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#a096c42733e9be0769163e96771c8fc6a">   77</a></span><a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* <a class="code hl_function" href="classnz_1_1_model.html#a096c42733e9be0769163e96771c8fc6a">nz::Model::Reshape</a>(<a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* input, <span class="keyword">const</span> <a class="code hl_class" href="classnz_1_1data_1_1_dimension.html">Tensor::shape_type</a>&amp; shape) {</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno">   78</span>    <span class="keywordflow">if</span> (!computeGraph.inGraph(input)) {</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno">   79</span>        computeGraph.addNode(input);</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno">   80</span>    }</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span>    <span class="keyword">auto</span>* reshapeNode = <span class="keyword">new</span> <a class="code hl_class" href="classnz_1_1nodes_1_1calc_1_1_reshape_node.html">calc::ReshapeNode</a>(input, shape);</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno">   82</span>    hiddenNodes.push_back(reshapeNode);</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno">   83</span>    computeGraph.addNode(reshapeNode);</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno">   84</span>    <span class="keywordflow">return</span> reshapeNode;</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno">   85</span>}</div>
</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno">   86</span> </div>
<div class="foldopen" id="foldopen00087" data-start="{" data-end="}">
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#ad89d39c92af525d2b4fe61bbaa73b176">   87</a></span><a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* <a class="code hl_function" href="classnz_1_1_model.html#ad89d39c92af525d2b4fe61bbaa73b176">nz::Model::Linear</a>(<a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* input, <span class="keywordtype">size_t</span> outSize) {</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span>    <span class="keyword">auto</span> inputSize = input-&gt;output-&gt;shape()[1] * input-&gt;output-&gt;shape()[2] * input-&gt;output-&gt;shape()[3];</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno">   89</span>    <a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* shapedInput;</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno">   90</span>    <span class="keywordflow">if</span> (input-&gt;output-&gt;shape()[2] != inputSize) {</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno">   91</span>        shapedInput = Reshape(input, {input-&gt;output-&gt;shape()[0], 1, inputSize, 1});</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno">   92</span>    }</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span>    <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span>        shapedInput = input;</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno">   95</span>    }</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno">   96</span>    <span class="keyword">auto</span> mulParam = <span class="keyword">new</span> <a class="code hl_class" href="classnz_1_1nodes_1_1io_1_1_input_node.html">io::InputNode</a>({1, 1, outSize, inputSize}, <span class="keyword">true</span>);</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno">   97</span>    mulParam-&gt;output-&gt;randomize();</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno">   98</span>    hiddenNodes.push_back(mulParam);</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno">   99</span>    computeGraph.addNode(mulParam);</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno">  100</span>    <span class="keyword">auto</span> mulResult = Mul(mulParam, shapedInput);</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno">  101</span>    <span class="keyword">auto</span> biasResult = Bias(mulResult);</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno">  102</span>    <span class="keywordflow">return</span> biasResult;</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno">  103</span>}</div>
</div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno">  104</span> </div>
<div class="foldopen" id="foldopen00105" data-start="{" data-end="}">
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#a31eb30e20ef27dbbb828ee006d5d1ba2">  105</a></span><a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* <a class="code hl_function" href="classnz_1_1_model.html#a31eb30e20ef27dbbb828ee006d5d1ba2">nz::Model::ReLU</a>(<a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* input) {</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno">  106</span>    <span class="keywordflow">if</span> (!computeGraph.inGraph(input)) {</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno">  107</span>        computeGraph.addNode(input);</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno">  108</span>    }</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno">  109</span>    <span class="keyword">auto</span>* reluNode = <span class="keyword">new</span> <a class="code hl_class" href="classnz_1_1nodes_1_1calc_1_1_re_l_u_node.html">calc::ReLUNode</a>(input);</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno">  110</span>    hiddenNodes.push_back(reluNode);</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno">  111</span>    computeGraph.addNode(reluNode);</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno">  112</span>    <span class="keywordflow">return</span> reluNode;</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno">  113</span>}</div>
</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno">  114</span> </div>
<div class="foldopen" id="foldopen00115" data-start="{" data-end="}">
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#a8dc9c07fca0c48900ac15e4d1942deae">  115</a></span><a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* <a class="code hl_function" href="classnz_1_1_model.html#a8dc9c07fca0c48900ac15e4d1942deae">nz::Model::Sigmoid</a>(<a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* input) {</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno">  116</span>    <span class="keywordflow">if</span> (!computeGraph.inGraph(input)) {</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno">  117</span>        computeGraph.addNode(input);</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno">  118</span>    }</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno">  119</span>    <span class="keyword">auto</span>* sigmoidNode = <span class="keyword">new</span> <a class="code hl_class" href="classnz_1_1nodes_1_1calc_1_1_sigmoid_node.html">calc::SigmoidNode</a>(input);</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno">  120</span>    hiddenNodes.push_back(sigmoidNode);</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno">  121</span>    computeGraph.addNode(sigmoidNode);</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno">  122</span>    <span class="keywordflow">return</span> sigmoidNode;</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno">  123</span>}</div>
</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno">  124</span> </div>
<div class="foldopen" id="foldopen00125" data-start="{" data-end="}">
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#ac1222f9af5950074155ff7da5343d094">  125</a></span><a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* <a class="code hl_function" href="classnz_1_1_model.html#ac1222f9af5950074155ff7da5343d094">nz::Model::Tanh</a>(<a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* input) {</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno">  126</span>    <span class="keywordflow">if</span> (!computeGraph.inGraph(input)) {</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno">  127</span>        computeGraph.addNode(input);</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno">  128</span>    }</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno">  129</span>    <span class="keyword">auto</span>* tanhNode = <span class="keyword">new</span> <a class="code hl_class" href="classnz_1_1nodes_1_1calc_1_1_tanh_node.html">calc::TanhNode</a>(input);</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno">  130</span>    hiddenNodes.push_back(tanhNode);</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno">  131</span>    computeGraph.addNode(tanhNode);</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno">  132</span>    <span class="keywordflow">return</span> tanhNode;</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno">  133</span>}</div>
</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno">  134</span> </div>
<div class="foldopen" id="foldopen00135" data-start="{" data-end="}">
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#aeb6ef61dee2d34121bd217d245e7a550">  135</a></span><a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* <a class="code hl_function" href="classnz_1_1_model.html#aeb6ef61dee2d34121bd217d245e7a550">nz::Model::LeakyReLU</a>(<a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* input, <span class="keyword">const</span> <span class="keywordtype">float</span> alpha) {</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno">  136</span>    <span class="keywordflow">if</span> (!computeGraph.inGraph(input)) {</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno">  137</span>        computeGraph.addNode(input);</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno">  138</span>    }</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno">  139</span>    <span class="keyword">auto</span>* leakyReLUNode = <span class="keyword">new</span> <a class="code hl_class" href="classnz_1_1nodes_1_1calc_1_1_leaky_re_l_u_node.html">calc::LeakyReLUNode</a>(input, alpha);</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno">  140</span>    hiddenNodes.push_back(leakyReLUNode);</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno">  141</span>    computeGraph.addNode(leakyReLUNode);</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno">  142</span>    <span class="keywordflow">return</span> leakyReLUNode;</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno">  143</span>}</div>
</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno">  144</span> </div>
<div class="foldopen" id="foldopen00145" data-start="{" data-end="}">
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#aefed3cd3f03db21d52713cd5779885b4">  145</a></span><a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* <a class="code hl_function" href="classnz_1_1_model.html#aefed3cd3f03db21d52713cd5779885b4">nz::Model::Swish</a>(<a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* input) {</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno">  146</span>    <span class="keywordflow">if</span> (!computeGraph.inGraph(input)) {</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno">  147</span>        computeGraph.addNode(input);</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno">  148</span>    }</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno">  149</span>    <span class="keyword">auto</span>* swishNode = <span class="keyword">new</span> <a class="code hl_class" href="classnz_1_1nodes_1_1calc_1_1_swish_node.html">calc::SwishNode</a>(input);</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno">  150</span>    hiddenNodes.push_back(swishNode);</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno">  151</span>    computeGraph.addNode(swishNode);</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno">  152</span>    <span class="keywordflow">return</span> swishNode;</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno">  153</span>}</div>
</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno">  154</span> </div>
<div class="foldopen" id="foldopen00155" data-start="{" data-end="}">
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#a245fdbd9c35986f392dea962a2be9952">  155</a></span><a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* <a class="code hl_function" href="classnz_1_1_model.html#a245fdbd9c35986f392dea962a2be9952">nz::Model::ELU</a>(<a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* input, <span class="keyword">const</span> <span class="keywordtype">float</span> alpha) {</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno">  156</span>    <span class="keywordflow">if</span> (!computeGraph.inGraph(input)) {</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno">  157</span>        computeGraph.addNode(input);</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno">  158</span>    }</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno">  159</span>    <span class="keyword">auto</span>* eluNode = <span class="keyword">new</span> <a class="code hl_class" href="classnz_1_1nodes_1_1calc_1_1_e_l_u_node.html">calc::ELUNode</a>(input, alpha);</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno">  160</span>    hiddenNodes.push_back(eluNode);</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno">  161</span>    computeGraph.addNode(eluNode);</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno">  162</span>    <span class="keywordflow">return</span> eluNode;</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno">  163</span>}</div>
</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno">  164</span> </div>
<div class="foldopen" id="foldopen00165" data-start="{" data-end="}">
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#a569c6457d8f601d8f2a72f2194c4939e">  165</a></span><a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* <a class="code hl_function" href="classnz_1_1_model.html#a569c6457d8f601d8f2a72f2194c4939e">nz::Model::HardSigmoid</a>(<a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* input, <span class="keyword">const</span> <span class="keywordtype">float</span> alpha, <span class="keyword">const</span> <span class="keywordtype">float</span> beta) {</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno">  166</span>    <span class="keywordflow">if</span> (!computeGraph.inGraph(input)) {</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno">  167</span>        computeGraph.addNode(input);</div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno">  168</span>    }</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno">  169</span>    <span class="keyword">auto</span>* hardSigmoidNode = <span class="keyword">new</span> <a class="code hl_class" href="classnz_1_1nodes_1_1calc_1_1_hard_sigmoid_node.html">calc::HardSigmoidNode</a>(input, alpha, beta);</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno">  170</span>    hiddenNodes.push_back(hardSigmoidNode);</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno">  171</span>    computeGraph.addNode(hardSigmoidNode);</div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno">  172</span>    <span class="keywordflow">return</span> hardSigmoidNode;</div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno">  173</span>}</div>
</div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno">  174</span> </div>
<div class="foldopen" id="foldopen00175" data-start="{" data-end="}">
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#a641ce5a53862f38fd0932c678011fc1d">  175</a></span><a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* <a class="code hl_function" href="classnz_1_1_model.html#a641ce5a53862f38fd0932c678011fc1d">nz::Model::HardSwish</a>(<a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* input, <span class="keywordtype">float</span> alpha, <span class="keywordtype">float</span> beta) {</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno">  176</span>    <span class="keywordflow">if</span> (!computeGraph.inGraph(input)) {</div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno">  177</span>        computeGraph.addNode(input);</div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno">  178</span>    }</div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno">  179</span>    <span class="keyword">auto</span>* hardSwishNode = <span class="keyword">new</span> <a class="code hl_class" href="classnz_1_1nodes_1_1calc_1_1_hard_swish_node.html">calc::HardSwishNode</a>(input, alpha, beta);</div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno">  180</span>    hiddenNodes.push_back(hardSwishNode);</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno">  181</span>    computeGraph.addNode(hardSwishNode);</div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno">  182</span>    <span class="keywordflow">return</span> hardSwishNode;</div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno">  183</span>}</div>
</div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno">  184</span> </div>
<div class="foldopen" id="foldopen00185" data-start="{" data-end="}">
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#a6679925ff2f38826fc3d743eed5ba74a">  185</a></span><a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* <a class="code hl_function" href="classnz_1_1_model.html#a6679925ff2f38826fc3d743eed5ba74a">nz::Model::Softmax</a>(<a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* input) {</div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno">  186</span>    <span class="keywordflow">if</span> (!computeGraph.inGraph(input)) {</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno">  187</span>        computeGraph.addNode(input);</div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno">  188</span>    }</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno">  189</span>    <span class="keyword">auto</span> size = input-&gt;output-&gt;shape()[1] * input-&gt;output-&gt;shape()[2] * input-&gt;output-&gt;shape()[3];</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno">  190</span>    <span class="keyword">auto</span> batch = input-&gt;output-&gt;shape()[0];</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno">  191</span>    <a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* reshapedInput;</div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno">  192</span>    <span class="keywordflow">if</span> (input-&gt;output-&gt;shape()[2] != size) {</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno">  193</span>        reshapedInput = Reshape(input, {batch, 1, size, 1});</div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno">  194</span>    }</div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno">  195</span>    <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno">  196</span>        reshapedInput = input;</div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno">  197</span>    }</div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno">  198</span>    <span class="keyword">auto</span>* softmaxNode = <span class="keyword">new</span> <a class="code hl_class" href="classnz_1_1nodes_1_1calc_1_1_softmax_node.html">calc::SoftmaxNode</a>(reshapedInput);</div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno">  199</span>    hiddenNodes.push_back(softmaxNode);</div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno">  200</span>    computeGraph.addNode(softmaxNode);</div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno">  201</span>    <span class="keywordflow">return</span> softmaxNode;</div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno">  202</span>}</div>
</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno">  203</span> </div>
<div class="foldopen" id="foldopen00204" data-start="{" data-end="}">
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#ac56811d7f31c2c9b8acd7133d0245194">  204</a></span><a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* <a class="code hl_function" href="classnz_1_1_model.html#ac56811d7f31c2c9b8acd7133d0245194">nz::Model::TargetExpand</a>(<a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* input, <span class="keyword">const</span> <a class="code hl_class" href="classnz_1_1data_1_1_dimension.html">Tensor::shape_type</a>&amp; shape) {</div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno">  205</span>    <span class="keywordflow">if</span> (!computeGraph.inGraph(input)) {</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno">  206</span>        computeGraph.addNode(input);</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno">  207</span>    }</div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno">  208</span>    <span class="keywordflow">if</span> (input-&gt;output-&gt;shape() == shape) {</div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno">  209</span>        <span class="keywordflow">return</span> input;</div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno">  210</span>    }</div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno">  211</span>    <span class="keywordflow">if</span> (input-&gt;output-&gt;shape()[0] != 1 ||</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno">  212</span>        input-&gt;output-&gt;shape()[1] != shape[1] ||</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno">  213</span>        input-&gt;output-&gt;shape()[2] != shape[2] ||</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno">  214</span>        input-&gt;output-&gt;shape()[3] != shape[3]) {</div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno">  215</span>        <span class="keywordflow">throw</span> std::runtime_error(<span class="stringliteral">&quot;The input data cannot be expanded.&quot;</span>);</div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno">  216</span>    }</div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno">  217</span>    <span class="keyword">auto</span>* expandNode = <span class="keyword">new</span> <a class="code hl_class" href="classnz_1_1nodes_1_1calc_1_1_expand_node.html">calc::ExpandNode</a>(input, shape.<a class="code hl_function" href="classnz_1_1data_1_1_dimension.html#acc472e84b4c44f649f34b6fbb0eeacf7">N</a>());</div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno">  218</span>    hiddenNodes.push_back(expandNode);</div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno">  219</span>    computeGraph.addNode(expandNode);</div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno">  220</span>    <span class="keywordflow">return</span> expandNode;</div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno">  221</span>}</div>
</div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno">  222</span> </div>
<div class="foldopen" id="foldopen00223" data-start="{" data-end="}">
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#a5362f52040494ef8b928a06cd08b0182">  223</a></span><a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* <a class="code hl_function" href="classnz_1_1_model.html#a5362f52040494ef8b928a06cd08b0182">nz::Model::Img2Col</a>(<a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* input, <span class="keyword">const</span> Tensor::size_type kernelHeight, <span class="keyword">const</span> Tensor::size_type kernelWidth,</div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno">  224</span>                         <span class="keyword">const</span> Tensor::size_type stride, <span class="keyword">const</span> Tensor::size_type padding) {</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno">  225</span>    <span class="keywordflow">if</span> (!computeGraph.inGraph(input)) {</div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno">  226</span>        computeGraph.addNode(input);</div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno">  227</span>    }</div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno">  228</span>    <span class="keyword">auto</span>* img2ColNode = <span class="keyword">new</span> <a class="code hl_class" href="classnz_1_1nodes_1_1calc_1_1_img2_col_node.html">calc::Img2ColNode</a>(input, kernelHeight, kernelWidth, stride, padding);</div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno">  229</span>    hiddenNodes.push_back(img2ColNode);</div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno">  230</span>    computeGraph.addNode(img2ColNode);</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno">  231</span>    <span class="keywordflow">return</span> img2ColNode;</div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno">  232</span>}</div>
</div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno">  233</span> </div>
<div class="foldopen" id="foldopen00234" data-start="{" data-end="}">
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#a3d285854fe406a71dbc78c5520a8cf53">  234</a></span><a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* <a class="code hl_function" href="classnz_1_1_model.html#a3d285854fe406a71dbc78c5520a8cf53">nz::Model::Col2Img</a>(<a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* input, Tensor::size_type outputHeight, Tensor::size_type outputWidth) {</div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno">  235</span>    <span class="keywordflow">if</span> (!computeGraph.inGraph(input)) {</div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno">  236</span>        computeGraph.addNode(input);</div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno">  237</span>    }</div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno">  238</span>    <span class="keyword">auto</span>* col2ImgNode = <span class="keyword">new</span> <a class="code hl_class" href="classnz_1_1nodes_1_1calc_1_1_col2_img_node.html">calc::Col2ImgNode</a>(input, outputHeight, outputWidth);</div>
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno">  239</span>    hiddenNodes.push_back(col2ImgNode);</div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno">  240</span>    computeGraph.addNode(col2ImgNode);</div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno">  241</span>    <span class="keywordflow">return</span> col2ImgNode;</div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno">  242</span>}</div>
</div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno">  243</span> </div>
<div class="foldopen" id="foldopen00244" data-start="{" data-end="}">
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#ab4cff0a1168496158b6face18be127cc">  244</a></span><a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* <a class="code hl_function" href="classnz_1_1_model.html#ab4cff0a1168496158b6face18be127cc">nz::Model::Conv2d</a>(<a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* input, Tensor::size_type outChannels, Tensor::size_type kernelHeight,</div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno">  245</span>                        Tensor::size_type kernelWidth, Tensor::size_type stride, Tensor::size_type padding, <span class="keywordtype">bool</span> bias) {</div>
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno">  246</span>    <span class="keywordflow">if</span> (!computeGraph.inGraph(input)) {</div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno">  247</span>        computeGraph.addNode(input);</div>
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno">  248</span>    }</div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno">  249</span>    <span class="keyword">auto</span>* convKernel = <span class="keyword">new</span> <a class="code hl_class" href="classnz_1_1nodes_1_1io_1_1_input_node.html">io::InputNode</a>({</div>
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno">  250</span>                                             input-&gt;output-&gt;shape().N(), 1,</div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno">  251</span>                                             input-&gt;output-&gt;shape().C() * kernelHeight * kernelWidth, outChannels</div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno">  252</span>                                         }, <span class="keyword">true</span>);</div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno">  253</span>    convKernel-&gt;output-&gt;randomize();</div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno">  254</span>    hiddenNodes.push_back(convKernel);</div>
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno">  255</span>    computeGraph.addNode(convKernel);</div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno">  256</span>    <span class="keyword">auto</span> inputCol = Img2Col(input, kernelHeight, kernelWidth, stride, padding);</div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno">  257</span>    <span class="keyword">auto</span> resultCol = Mul(inputCol, convKernel);</div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno">  258</span>    <span class="keywordflow">if</span> (bias) {</div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno">  259</span>        resultCol = Bias(resultCol);</div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno">  260</span>    }</div>
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno">  261</span>    <span class="keywordflow">return</span> Col2Img(resultCol, (input-&gt;output-&gt;shape().H() + 2 * padding - kernelHeight) / stride + 1,</div>
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno">  262</span>                   (input-&gt;output-&gt;shape().W() + 2 * padding - kernelWidth) / stride + 1);</div>
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno">  263</span>}</div>
</div>
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno">  264</span> </div>
<div class="foldopen" id="foldopen00265" data-start="{" data-end="}">
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#aa7015b454f407a1dc06a597686484a93">  265</a></span><a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* <a class="code hl_function" href="classnz_1_1_model.html#aa7015b454f407a1dc06a597686484a93">nz::Model::AvgPool2d</a>(<a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* input, Tensor::size_type poolSize, Tensor::size_type stride,</div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno">  266</span>    Tensor::size_type padding) {</div>
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno">  267</span>        <span class="keywordflow">if</span> (!computeGraph.inGraph(input)) {</div>
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno">  268</span>            computeGraph.addNode(input);</div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno">  269</span>        }</div>
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno">  270</span>        <span class="keyword">auto</span>* avgPoolNode = <span class="keyword">new</span> <a class="code hl_class" href="classnz_1_1nodes_1_1calc_1_1_average_pooling_node.html">calc::AveragePoolingNode</a>(input, poolSize, stride, padding);</div>
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno">  271</span>        hiddenNodes.push_back(avgPoolNode);</div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno">  272</span>        computeGraph.addNode(avgPoolNode);</div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno">  273</span>        <span class="keywordflow">return</span> avgPoolNode;</div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno">  274</span>}</div>
</div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno">  275</span> </div>
<div class="foldopen" id="foldopen00276" data-start="{" data-end="}">
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#ac9794451b47deb3d2f6061fa808bed69">  276</a></span><a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* <a class="code hl_function" href="classnz_1_1_model.html#ac9794451b47deb3d2f6061fa808bed69">nz::Model::GlobalAvgPool2d</a>(<a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* input) {</div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno">  277</span>    <span class="keywordflow">if</span> (!computeGraph.inGraph(input)) {</div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno">  278</span>        computeGraph.addNode(input);</div>
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno">  279</span>    }</div>
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno">  280</span>    <span class="keyword">auto</span>* globalAvgPoolNode = <span class="keyword">new</span> <a class="code hl_class" href="classnz_1_1nodes_1_1calc_1_1_global_avg_pool_node.html">calc::GlobalAvgPoolNode</a>(input);</div>
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno">  281</span>    hiddenNodes.push_back(globalAvgPoolNode);</div>
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno">  282</span>    computeGraph.addNode(globalAvgPoolNode);</div>
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno">  283</span>    <span class="keywordflow">return</span> globalAvgPoolNode;</div>
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno">  284</span>}</div>
</div>
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno">  285</span> </div>
<div class="foldopen" id="foldopen00286" data-start="{" data-end="}">
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#a4767537c6b6d13d6296e2fbe4518044c">  286</a></span><a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* <a class="code hl_function" href="classnz_1_1_model.html#a4767537c6b6d13d6296e2fbe4518044c">nz::Model::MaxPool2d</a>(<a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* input, Tensor::size_type poolSize, Tensor::size_type stride,</div>
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno">  287</span>    Tensor::size_type padding) {</div>
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno">  288</span>    <span class="keywordflow">if</span> (!computeGraph.inGraph(input)) {</div>
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno">  289</span>        computeGraph.addNode(input);</div>
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno">  290</span>    }</div>
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno">  291</span>    <span class="keyword">auto</span>* maxPoolNode = <span class="keyword">new</span> <a class="code hl_class" href="classnz_1_1nodes_1_1calc_1_1_max_pooling_node.html">calc::MaxPoolingNode</a>(input, poolSize, stride, padding);</div>
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno">  292</span>    hiddenNodes.push_back(maxPoolNode);</div>
<div class="line"><a id="l00293" name="l00293"></a><span class="lineno">  293</span>    computeGraph.addNode(maxPoolNode);</div>
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno">  294</span>    <span class="keywordflow">return</span> maxPoolNode;</div>
<div class="line"><a id="l00295" name="l00295"></a><span class="lineno">  295</span>}</div>
</div>
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno">  296</span> </div>
<div class="foldopen" id="foldopen00297" data-start="{" data-end="}">
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#ab6c8949a1efe25a3662cf9f937e494fc">  297</a></span><a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* <a class="code hl_function" href="classnz_1_1_model.html#ab6c8949a1efe25a3662cf9f937e494fc">nz::Model::GlobalMaxPool2d</a>(<a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* input) {</div>
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno">  298</span>    <span class="keywordflow">if</span> (!computeGraph.inGraph(input)) {</div>
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno">  299</span>        computeGraph.addNode(input);</div>
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno">  300</span>    }</div>
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno">  301</span>    <span class="keyword">auto</span>* globalMaxPoolNode = <span class="keyword">new</span> <a class="code hl_class" href="classnz_1_1nodes_1_1calc_1_1_global_max_pool_node.html">calc::GlobalMaxPoolNode</a>(input);</div>
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno">  302</span>    hiddenNodes.push_back(globalMaxPoolNode);</div>
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno">  303</span>    computeGraph.addNode(globalMaxPoolNode);</div>
<div class="line"><a id="l00304" name="l00304"></a><span class="lineno">  304</span>    <span class="keywordflow">return</span> globalMaxPoolNode;</div>
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno">  305</span>}</div>
</div>
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno">  306</span> </div>
<div class="foldopen" id="foldopen00307" data-start="{" data-end="}">
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#a5e0d05f5a9c9bf4114065680c152a044">  307</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1_model.html#a5e0d05f5a9c9bf4114065680c152a044">nz::Model::MSELoss</a>(<a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* input, <a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* target) {</div>
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno">  308</span>    <span class="keywordflow">if</span> (!computeGraph.inGraph(input)) {</div>
<div class="line"><a id="l00309" name="l00309"></a><span class="lineno">  309</span>        computeGraph.addNode(input);</div>
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno">  310</span>    }</div>
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno">  311</span>    <span class="keyword">auto</span>* expandedTarget = TargetExpand(target, input-&gt;output-&gt;shape());</div>
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno">  312</span>    <span class="keyword">auto</span>* mseNode = <span class="keyword">new</span> <a class="code hl_class" href="classnz_1_1nodes_1_1loss_1_1_mean_squared_error_node.html">loss::MeanSquaredErrorNode</a>(input, expandedTarget);</div>
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno">  313</span>    hiddenNodes.push_back(mseNode);</div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno">  314</span>    computeGraph.addOutput(mseNode);</div>
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno">  315</span>}</div>
</div>
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno">  316</span> </div>
<div class="foldopen" id="foldopen00317" data-start="{" data-end="}">
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#a8bafd2b31ffecd96eb7c9e6eae1d889b">  317</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1_model.html#a8bafd2b31ffecd96eb7c9e6eae1d889b">nz::Model::BCELoss</a>(<a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* input, <a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* target) {</div>
<div class="line"><a id="l00318" name="l00318"></a><span class="lineno">  318</span>    <span class="keywordflow">if</span> (!computeGraph.inGraph(input)) {</div>
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno">  319</span>        computeGraph.addNode(input);</div>
<div class="line"><a id="l00320" name="l00320"></a><span class="lineno">  320</span>    }</div>
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno">  321</span>    <span class="keyword">auto</span>* expandedTarget = TargetExpand(target, input-&gt;output-&gt;shape());</div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno">  322</span>    <span class="keyword">auto</span>* bceNode = <span class="keyword">new</span> <a class="code hl_class" href="classnz_1_1nodes_1_1loss_1_1_binary_cross_entropy_node.html">loss::BinaryCrossEntropyNode</a>(input, expandedTarget);</div>
<div class="line"><a id="l00323" name="l00323"></a><span class="lineno">  323</span>    hiddenNodes.push_back(bceNode);</div>
<div class="line"><a id="l00324" name="l00324"></a><span class="lineno">  324</span>    computeGraph.addOutput(bceNode);</div>
<div class="line"><a id="l00325" name="l00325"></a><span class="lineno">  325</span>}</div>
</div>
<div class="line"><a id="l00326" name="l00326"></a><span class="lineno">  326</span> </div>
<div class="foldopen" id="foldopen00327" data-start="{" data-end="}">
<div class="line"><a id="l00327" name="l00327"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#a72bcbb7537e396d5fef9931e3a92b017">  327</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1_model.html#a72bcbb7537e396d5fef9931e3a92b017">nz::Model::defaultOutput</a>(<a class="code hl_class" href="classnz_1_1nodes_1_1_node.html">Node</a>* input) {</div>
<div class="line"><a id="l00328" name="l00328"></a><span class="lineno">  328</span>    <span class="keyword">auto</span>* output = <span class="keyword">new</span> <a class="code hl_class" href="classnz_1_1nodes_1_1io_1_1_output_node.html">io::OutputNode</a>(input);</div>
<div class="line"><a id="l00329" name="l00329"></a><span class="lineno">  329</span>    hiddenNodes.push_back(output);</div>
<div class="line"><a id="l00330" name="l00330"></a><span class="lineno">  330</span>    computeGraph.addOutput(output);</div>
<div class="line"><a id="l00331" name="l00331"></a><span class="lineno">  331</span>    <span class="keywordflow">if</span> (!computeGraph.inGraph(input)) {</div>
<div class="line"><a id="l00332" name="l00332"></a><span class="lineno">  332</span>        computeGraph.addNode(input);</div>
<div class="line"><a id="l00333" name="l00333"></a><span class="lineno">  333</span>    }</div>
<div class="line"><a id="l00334" name="l00334"></a><span class="lineno">  334</span>}</div>
</div>
<div class="line"><a id="l00335" name="l00335"></a><span class="lineno">  335</span> </div>
<div class="foldopen" id="foldopen00372" data-start="{" data-end="}">
<div class="line"><a id="l00372" name="l00372"></a><span class="lineno"><a class="line" href="classnz_1_1_model.html#a8cc7ad3d047eee1bdb48e5fa0b16f460">  372</a></span>std::ostream&amp; <a class="code hl_function" href="classnz_1_1_model.html#a8cc7ad3d047eee1bdb48e5fa0b16f460">nz::operator&lt;&lt;</a>(std::ostream&amp; os, <a class="code hl_class" href="classnz_1_1_model.html">Model</a>&amp; model) {</div>
<div class="line"><a id="l00373" name="l00373"></a><span class="lineno">  373</span>    <span class="keywordflow">return</span> os &lt;&lt; model.computeGraph;</div>
<div class="line"><a id="l00374" name="l00374"></a><span class="lineno">  374</span>}</div>
</div>
<div class="ttc" id="a_model_8cuh_html"><div class="ttname"><a href="_model_8cuh.html">Model.cuh</a></div><div class="ttdoc">Core class for computational graph construction and neural network modeling.</div></div>
<div class="ttc" id="aclassnz_1_1_model_html"><div class="ttname"><a href="classnz_1_1_model.html">nz::Model</a></div><div class="ttdoc">Base class for constructing neural network models with automatic computation graph management.</div><div class="ttdef"><b>Definition</b> <a href="_model_8cuh_source.html#l00187">Model.cuh:187</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_a096c42733e9be0769163e96771c8fc6a"><div class="ttname"><a href="classnz_1_1_model.html#a096c42733e9be0769163e96771c8fc6a">nz::Model::Reshape</a></div><div class="ttdeci">Node * Reshape(Node *input, const Tensor::shape_type &amp;shape)</div><div class="ttdoc">Modifies tensor dimensions while preserving data (Low-level API)</div><div class="ttdef"><b>Definition</b> <a href="#l00077">Model.cu:77</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_a0ebe5c8d848f16af5d2a06592c3e2217"><div class="ttname"><a href="classnz_1_1_model.html#a0ebe5c8d848f16af5d2a06592c3e2217">nz::Model::Sub</a></div><div class="ttdeci">Node * Sub(Node *lhs, Node *rhs)</div><div class="ttdoc">Creates subtraction operation node in computation graph (Low-level API)</div><div class="ttdef"><b>Definition</b> <a href="#l00042">Model.cu:42</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_a245fdbd9c35986f392dea962a2be9952"><div class="ttname"><a href="classnz_1_1_model.html#a245fdbd9c35986f392dea962a2be9952">nz::Model::ELU</a></div><div class="ttdeci">Node * ELU(Node *input, float alpha=1.0f)</div><div class="ttdoc">Applies Exponential Linear Unit activation (Mid-level API)</div><div class="ttdef"><b>Definition</b> <a href="#l00155">Model.cu:155</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_a31eb30e20ef27dbbb828ee006d5d1ba2"><div class="ttname"><a href="classnz_1_1_model.html#a31eb30e20ef27dbbb828ee006d5d1ba2">nz::Model::ReLU</a></div><div class="ttdeci">Node * ReLU(Node *input)</div><div class="ttdoc">Applies Rectified Linear Unit activation (Mid-level API)</div><div class="ttdef"><b>Definition</b> <a href="#l00105">Model.cu:105</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_a3d285854fe406a71dbc78c5520a8cf53"><div class="ttname"><a href="classnz_1_1_model.html#a3d285854fe406a71dbc78c5520a8cf53">nz::Model::Col2Img</a></div><div class="ttdeci">Node * Col2Img(Node *input, Tensor::size_type outputHeight, Tensor::size_type outputWidth)</div><div class="ttdoc">(Low-level) Column-to-image transformation primitive</div><div class="ttdef"><b>Definition</b> <a href="#l00234">Model.cu:234</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_a4767537c6b6d13d6296e2fbe4518044c"><div class="ttname"><a href="classnz_1_1_model.html#a4767537c6b6d13d6296e2fbe4518044c">nz::Model::MaxPool2d</a></div><div class="ttdeci">Node * MaxPool2d(Node *input, Tensor::size_type poolSize, Tensor::size_type stride, Tensor::size_type padding=0)</div><div class="ttdoc">Performs 2D maximum pooling operation.</div><div class="ttdef"><b>Definition</b> <a href="#l00286">Model.cu:286</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_a5362f52040494ef8b928a06cd08b0182"><div class="ttname"><a href="classnz_1_1_model.html#a5362f52040494ef8b928a06cd08b0182">nz::Model::Img2Col</a></div><div class="ttdeci">Node * Img2Col(Node *input, Tensor::size_type kernelHeight, Tensor::size_type kernelWidth, Tensor::size_type stride, Tensor::size_type padding)</div><div class="ttdoc">(Low-level) Image-to-column transformation primitive</div><div class="ttdef"><b>Definition</b> <a href="#l00223">Model.cu:223</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_a569c6457d8f601d8f2a72f2194c4939e"><div class="ttname"><a href="classnz_1_1_model.html#a569c6457d8f601d8f2a72f2194c4939e">nz::Model::HardSigmoid</a></div><div class="ttdeci">Node * HardSigmoid(Node *input, float alpha=0.2f, float beta=0.5f)</div><div class="ttdoc">Applies piecewise linear sigmoid approximation (Mid-level API)</div><div class="ttdef"><b>Definition</b> <a href="#l00165">Model.cu:165</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_a5e0d05f5a9c9bf4114065680c152a044"><div class="ttname"><a href="classnz_1_1_model.html#a5e0d05f5a9c9bf4114065680c152a044">nz::Model::MSELoss</a></div><div class="ttdeci">void MSELoss(Node *input, Node *target)</div><div class="ttdoc">Establishes Mean Squared Error loss node as computational graph terminal.</div><div class="ttdef"><b>Definition</b> <a href="#l00307">Model.cu:307</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_a641ce5a53862f38fd0932c678011fc1d"><div class="ttname"><a href="classnz_1_1_model.html#a641ce5a53862f38fd0932c678011fc1d">nz::Model::HardSwish</a></div><div class="ttdeci">Node * HardSwish(Node *input, float alpha=0.2f, float beta=0.5f)</div><div class="ttdoc">Applies hardware-efficient swish activation (Mid-level API)</div><div class="ttdef"><b>Definition</b> <a href="#l00175">Model.cu:175</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_a6679925ff2f38826fc3d743eed5ba74a"><div class="ttname"><a href="classnz_1_1_model.html#a6679925ff2f38826fc3d743eed5ba74a">nz::Model::Softmax</a></div><div class="ttdeci">Node * Softmax(Node *input)</div><div class="ttdoc">Applies channel-wise probability normalization (High-level API)</div><div class="ttdef"><b>Definition</b> <a href="#l00185">Model.cu:185</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_a72bcbb7537e396d5fef9931e3a92b017"><div class="ttname"><a href="classnz_1_1_model.html#a72bcbb7537e396d5fef9931e3a92b017">nz::Model::defaultOutput</a></div><div class="ttdeci">void defaultOutput(Node *input)</div><div class="ttdoc">Provides zero-overhead tensor passthrough for inference outputs.</div><div class="ttdef"><b>Definition</b> <a href="#l00327">Model.cu:327</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_a8bafd2b31ffecd96eb7c9e6eae1d889b"><div class="ttname"><a href="classnz_1_1_model.html#a8bafd2b31ffecd96eb7c9e6eae1d889b">nz::Model::BCELoss</a></div><div class="ttdeci">void BCELoss(Node *input, Node *target)</div><div class="ttdoc">Configures Binary Cross-Entropy loss as computation graph endpoint.</div><div class="ttdef"><b>Definition</b> <a href="#l00317">Model.cu:317</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_a8cc7ad3d047eee1bdb48e5fa0b16f460"><div class="ttname"><a href="classnz_1_1_model.html#a8cc7ad3d047eee1bdb48e5fa0b16f460">nz::Model::operator&lt;&lt;</a></div><div class="ttdeci">std::ostream &amp; operator&lt;&lt;(std::ostream &amp;os, Model &amp;model)</div><div class="ttdoc">Serializes neural network computation graph structure to output stream.</div><div class="ttdef"><b>Definition</b> <a href="#l00372">Model.cu:372</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_a8dc9c07fca0c48900ac15e4d1942deae"><div class="ttname"><a href="classnz_1_1_model.html#a8dc9c07fca0c48900ac15e4d1942deae">nz::Model::Sigmoid</a></div><div class="ttdeci">Node * Sigmoid(Node *input)</div><div class="ttdoc">Applies logistic sigmoid activation (Mid-level API)</div><div class="ttdef"><b>Definition</b> <a href="#l00115">Model.cu:115</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_a9060c98c30fb2388a9fd3ae9af67a046"><div class="ttname"><a href="classnz_1_1_model.html#a9060c98c30fb2388a9fd3ae9af67a046">nz::Model::update</a></div><div class="ttdeci">void update(opt::Optimizer *optimizer) const</div><div class="ttdoc">Applies parameter updates using attached optimization strategy.</div><div class="ttdef"><b>Definition</b> <a href="#l00020">Model.cu:20</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_aa7015b454f407a1dc06a597686484a93"><div class="ttname"><a href="classnz_1_1_model.html#aa7015b454f407a1dc06a597686484a93">nz::Model::AvgPool2d</a></div><div class="ttdeci">Node * AvgPool2d(Node *input, Tensor::size_type poolSize, Tensor::size_type stride, Tensor::size_type padding=0)</div><div class="ttdoc">Performs 2D average pooling operation (Sliding window)</div><div class="ttdef"><b>Definition</b> <a href="#l00265">Model.cu:265</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_aaabce965b32aa9e32a961631dcdd6540"><div class="ttname"><a href="classnz_1_1_model.html#aaabce965b32aa9e32a961631dcdd6540">nz::Model::Add</a></div><div class="ttdeci">Node * Add(Node *lhs, Node *rhs)</div><div class="ttdoc">Creates addition operation node in computation graph (Low-level API)</div><div class="ttdef"><b>Definition</b> <a href="#l00029">Model.cu:29</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_ab4cff0a1168496158b6face18be127cc"><div class="ttname"><a href="classnz_1_1_model.html#ab4cff0a1168496158b6face18be127cc">nz::Model::Conv2d</a></div><div class="ttdeci">Node * Conv2d(Node *input, Tensor::size_type outChannels, Tensor::size_type kernelHeight, Tensor::size_type kernelWidth, Tensor::size_type stride, Tensor::size_type padding, bool bias=true)</div><div class="ttdoc">Executes optimized convolution using img2col acceleration (High-level API)</div><div class="ttdef"><b>Definition</b> <a href="#l00244">Model.cu:244</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_ab6c8949a1efe25a3662cf9f937e494fc"><div class="ttname"><a href="classnz_1_1_model.html#ab6c8949a1efe25a3662cf9f937e494fc">nz::Model::GlobalMaxPool2d</a></div><div class="ttdeci">Node * GlobalMaxPool2d(Node *input)</div><div class="ttdoc">Computes global maximum pooling over spatial axes.</div><div class="ttdef"><b>Definition</b> <a href="#l00297">Model.cu:297</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_abd63329d440cd96c832cbea7c7dfd133"><div class="ttname"><a href="classnz_1_1_model.html#abd63329d440cd96c832cbea7c7dfd133">nz::Model::Model</a></div><div class="ttdeci">Model()</div><div class="ttdoc">Default constructs Model instance with empty computation graph.</div></div>
<div class="ttc" id="aclassnz_1_1_model_html_ac1222f9af5950074155ff7da5343d094"><div class="ttname"><a href="classnz_1_1_model.html#ac1222f9af5950074155ff7da5343d094">nz::Model::Tanh</a></div><div class="ttdeci">Node * Tanh(Node *input)</div><div class="ttdoc">Applies hyperbolic tangent activation (Mid-level API)</div><div class="ttdef"><b>Definition</b> <a href="#l00125">Model.cu:125</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_ac56811d7f31c2c9b8acd7133d0245194"><div class="ttname"><a href="classnz_1_1_model.html#ac56811d7f31c2c9b8acd7133d0245194">nz::Model::TargetExpand</a></div><div class="ttdeci">Node * TargetExpand(Node *input, const Tensor::shape_type &amp;shape)</div><div class="ttdoc">(Low-level) Batch expansion primitive for singleton tensors</div><div class="ttdef"><b>Definition</b> <a href="#l00204">Model.cu:204</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_ac9794451b47deb3d2f6061fa808bed69"><div class="ttname"><a href="classnz_1_1_model.html#ac9794451b47deb3d2f6061fa808bed69">nz::Model::GlobalAvgPool2d</a></div><div class="ttdeci">Node * GlobalAvgPool2d(Node *input)</div><div class="ttdoc">Computes global average pooling over spatial dimensions.</div><div class="ttdef"><b>Definition</b> <a href="#l00276">Model.cu:276</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_ac9eb518cab0e5df54b986ca6f0233964"><div class="ttname"><a href="classnz_1_1_model.html#ac9eb518cab0e5df54b986ca6f0233964">nz::Model::getLoss</a></div><div class="ttdeci">Tensor::value_type getLoss() const</div><div class="ttdoc">Retrieves scalar loss value from last forward pass.</div><div class="ttdef"><b>Definition</b> <a href="#l00025">Model.cu:25</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_ad061640ff58f4b09bc850019b27005a8"><div class="ttname"><a href="classnz_1_1_model.html#ad061640ff58f4b09bc850019b27005a8">nz::Model::forward</a></div><div class="ttdeci">Tensor &amp; forward()</div><div class="ttdoc">Executes full forward propagation through computation graph.</div><div class="ttdef"><b>Definition</b> <a href="#l00011">Model.cu:11</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_ad89d39c92af525d2b4fe61bbaa73b176"><div class="ttname"><a href="classnz_1_1_model.html#ad89d39c92af525d2b4fe61bbaa73b176">nz::Model::Linear</a></div><div class="ttdeci">Node * Linear(Node *input, size_t outSize)</div><div class="ttdoc">Implements fully-connected layer transformation (Top-level API)</div><div class="ttdef"><b>Definition</b> <a href="#l00087">Model.cu:87</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_adcd0e6d5ec7e297bf50cd8bbe2077767"><div class="ttname"><a href="classnz_1_1_model.html#adcd0e6d5ec7e297bf50cd8bbe2077767">nz::Model::Mul</a></div><div class="ttdeci">Node * Mul(Node *lhs, Node *rhs)</div><div class="ttdoc">Creates matrix multiplication node in computation graph (Low-level API)</div><div class="ttdef"><b>Definition</b> <a href="#l00055">Model.cu:55</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_aded49f9b1c9be002bc81ee72dd4e08ac"><div class="ttname"><a href="classnz_1_1_model.html#aded49f9b1c9be002bc81ee72dd4e08ac">nz::Model::backward</a></div><div class="ttdeci">void backward()</div><div class="ttdoc">Performs backward propagation and gradient accumulation.</div><div class="ttdef"><b>Definition</b> <a href="#l00016">Model.cu:16</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_aeb6ef61dee2d34121bd217d245e7a550"><div class="ttname"><a href="classnz_1_1_model.html#aeb6ef61dee2d34121bd217d245e7a550">nz::Model::LeakyReLU</a></div><div class="ttdeci">Node * LeakyReLU(Node *input, float alpha=0.01f)</div><div class="ttdoc">Applies Leaky Rectified Linear Unit activation (Mid-level API)</div><div class="ttdef"><b>Definition</b> <a href="#l00135">Model.cu:135</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_aefed3cd3f03db21d52713cd5779885b4"><div class="ttname"><a href="classnz_1_1_model.html#aefed3cd3f03db21d52713cd5779885b4">nz::Model::Swish</a></div><div class="ttdeci">Node * Swish(Node *input)</div><div class="ttdoc">Applies self-gated swish activation (Mid-level API)</div><div class="ttdef"><b>Definition</b> <a href="#l00145">Model.cu:145</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_af685ed9088799b290d5bd9d5b34cca95"><div class="ttname"><a href="classnz_1_1_model.html#af685ed9088799b290d5bd9d5b34cca95">nz::Model::Bias</a></div><div class="ttdeci">Node * Bias(Node *input)</div><div class="ttdoc">Creates trainable bias parameter and adds element-wise to input (Mid-level API)</div><div class="ttdef"><b>Definition</b> <a href="#l00068">Model.cu:68</a></div></div>
<div class="ttc" id="aclassnz_1_1_model_html_afaae0d794389dad645bc04558e1c3319"><div class="ttname"><a href="classnz_1_1_model.html#afaae0d794389dad645bc04558e1c3319">nz::Model::~Model</a></div><div class="ttdeci">~Model()</div><div class="ttdoc">Safely destructs Model and associated computation nodes.</div><div class="ttdef"><b>Definition</b> <a href="#l00005">Model.cu:5</a></div></div>
<div class="ttc" id="aclassnz_1_1data_1_1_dimension_html"><div class="ttname"><a href="classnz_1_1data_1_1_dimension.html">nz::data::Dimension</a></div><div class="ttdoc">Represents a multi - dimensional shape, typically used in deep learning for tensor dimensions.</div><div class="ttdef"><b>Definition</b> <a href="_dimension_8cuh_source.html#l00057">Dimension.cuh:57</a></div></div>
<div class="ttc" id="aclassnz_1_1data_1_1_dimension_html_acc472e84b4c44f649f34b6fbb0eeacf7"><div class="ttname"><a href="classnz_1_1data_1_1_dimension.html#acc472e84b4c44f649f34b6fbb0eeacf7">nz::data::Dimension::N</a></div><div class="ttdeci">size_t N() const</div><div class="ttdoc">Retrieves the value of the 'n' dimension.</div><div class="ttdef"><b>Definition</b> <a href="_dimension_8cu_source.html#l00051">Dimension.cu:51</a></div></div>
<div class="ttc" id="aclassnz_1_1data_1_1_tensor_html"><div class="ttname"><a href="classnz_1_1data_1_1_tensor.html">nz::data::Tensor</a></div><div class="ttdoc">A class for representing and manipulating multidimensional arrays (tensors) in GPU memory.</div><div class="ttdef"><b>Definition</b> <a href="_tensor_8cuh_source.html#l00134">Tensor.cuh:134</a></div></div>
<div class="ttc" id="aclassnz_1_1data_1_1_tensor_html_a6fed8efad540a7621dd6640b2f2466d0"><div class="ttname"><a href="classnz_1_1data_1_1_tensor.html#a6fed8efad540a7621dd6640b2f2466d0">nz::data::Tensor::zeroGrad</a></div><div class="ttdeci">void zeroGrad() const</div><div class="ttdoc">Resets the gradient data to zero.</div><div class="ttdef"><b>Definition</b> <a href="_tensor_8cu_source.html#l00246">Tensor.cu:246</a></div></div>
<div class="ttc" id="aclassnz_1_1nodes_1_1_node_html"><div class="ttname"><a href="classnz_1_1nodes_1_1_node.html">nz::nodes::Node</a></div><div class="ttdoc">Base class for nodes in a neural network or computational graph.</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cuh_source.html#l00114">Nodes.cuh:114</a></div></div>
<div class="ttc" id="aclassnz_1_1nodes_1_1calc_1_1_add_node_html"><div class="ttname"><a href="classnz_1_1nodes_1_1calc_1_1_add_node.html">nz::nodes::calc::AddNode</a></div><div class="ttdoc">Represents a node that performs element-wise addition between two input tensors.</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cuh_source.html#l00917">Nodes.cuh:917</a></div></div>
<div class="ttc" id="aclassnz_1_1nodes_1_1calc_1_1_average_pooling_node_html"><div class="ttname"><a href="classnz_1_1nodes_1_1calc_1_1_average_pooling_node.html">nz::nodes::calc::AveragePoolingNode</a></div><div class="ttdoc">Implements average pooling operation for spatial downsampling in neural networks.</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cuh_source.html#l04088">Nodes.cuh:4088</a></div></div>
<div class="ttc" id="aclassnz_1_1nodes_1_1calc_1_1_col2_img_node_html"><div class="ttname"><a href="classnz_1_1nodes_1_1calc_1_1_col2_img_node.html">nz::nodes::calc::Col2ImgNode</a></div><div class="ttdoc">Reconstructs spatial tensors from column matrices generated by im2col transformation.</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cuh_source.html#l03910">Nodes.cuh:3910</a></div></div>
<div class="ttc" id="aclassnz_1_1nodes_1_1calc_1_1_e_l_u_node_html"><div class="ttname"><a href="classnz_1_1nodes_1_1calc_1_1_e_l_u_node.html">nz::nodes::calc::ELUNode</a></div><div class="ttdoc">Represents an Exponential Linear Unit (ELU) activation function node in a computational graph.</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cuh_source.html#l02648">Nodes.cuh:2648</a></div></div>
<div class="ttc" id="aclassnz_1_1nodes_1_1calc_1_1_expand_node_html"><div class="ttname"><a href="classnz_1_1nodes_1_1calc_1_1_expand_node.html">nz::nodes::calc::ExpandNode</a></div><div class="ttdoc">Expands tensors with batch size 1 to arbitrary batch dimensions through data replication.</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cuh_source.html#l03536">Nodes.cuh:3536</a></div></div>
<div class="ttc" id="aclassnz_1_1nodes_1_1calc_1_1_global_avg_pool_node_html"><div class="ttname"><a href="classnz_1_1nodes_1_1calc_1_1_global_avg_pool_node.html">nz::nodes::calc::GlobalAvgPoolNode</a></div><div class="ttdoc">Performs global average pooling operation across spatial dimensions of input tensor.</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cuh_source.html#l04269">Nodes.cuh:4269</a></div></div>
<div class="ttc" id="aclassnz_1_1nodes_1_1calc_1_1_global_max_pool_node_html"><div class="ttname"><a href="classnz_1_1nodes_1_1calc_1_1_global_max_pool_node.html">nz::nodes::calc::GlobalMaxPoolNode</a></div><div class="ttdoc">Performs global max pooling operation across spatial dimensions of input tensor.</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cuh_source.html#l04619">Nodes.cuh:4619</a></div></div>
<div class="ttc" id="aclassnz_1_1nodes_1_1calc_1_1_hard_sigmoid_node_html"><div class="ttname"><a href="classnz_1_1nodes_1_1calc_1_1_hard_sigmoid_node.html">nz::nodes::calc::HardSigmoidNode</a></div><div class="ttdoc">Represents a Hard Sigmoid activation function node in a computational graph.</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cuh_source.html#l02803">Nodes.cuh:2803</a></div></div>
<div class="ttc" id="aclassnz_1_1nodes_1_1calc_1_1_hard_swish_node_html"><div class="ttname"><a href="classnz_1_1nodes_1_1calc_1_1_hard_swish_node.html">nz::nodes::calc::HardSwishNode</a></div><div class="ttdoc">Represents a Hard Swish activation function node in a computational graph.</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cuh_source.html#l02954">Nodes.cuh:2954</a></div></div>
<div class="ttc" id="aclassnz_1_1nodes_1_1calc_1_1_img2_col_node_html"><div class="ttname"><a href="classnz_1_1nodes_1_1calc_1_1_img2_col_node.html">nz::nodes::calc::Img2ColNode</a></div><div class="ttdoc">Implements im2col transformation for efficient convolution operations in neural networks.</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cuh_source.html#l03729">Nodes.cuh:3729</a></div></div>
<div class="ttc" id="aclassnz_1_1nodes_1_1calc_1_1_leaky_re_l_u_node_html"><div class="ttname"><a href="classnz_1_1nodes_1_1calc_1_1_leaky_re_l_u_node.html">nz::nodes::calc::LeakyReLUNode</a></div><div class="ttdoc">Represents a Leaky Rectified Linear Unit (LeakyReLU) activation function node in a computational grap...</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cuh_source.html#l02353">Nodes.cuh:2353</a></div></div>
<div class="ttc" id="aclassnz_1_1nodes_1_1calc_1_1_mat_mul_node_html"><div class="ttname"><a href="classnz_1_1nodes_1_1calc_1_1_mat_mul_node.html">nz::nodes::calc::MatMulNode</a></div><div class="ttdoc">Represents a matrix multiplication operation node in a computational graph.</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cuh_source.html#l01060">Nodes.cuh:1060</a></div></div>
<div class="ttc" id="aclassnz_1_1nodes_1_1calc_1_1_max_pooling_node_html"><div class="ttname"><a href="classnz_1_1nodes_1_1calc_1_1_max_pooling_node.html">nz::nodes::calc::MaxPoolingNode</a></div><div class="ttdoc">Implements max pooling operation for spatial downsampling with feature preservation.</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cuh_source.html#l04440">Nodes.cuh:4440</a></div></div>
<div class="ttc" id="aclassnz_1_1nodes_1_1calc_1_1_re_l_u_node_html"><div class="ttname"><a href="classnz_1_1nodes_1_1calc_1_1_re_l_u_node.html">nz::nodes::calc::ReLUNode</a></div><div class="ttdoc">Represents a Rectified Linear Unit (ReLU) operation node in a computational graph.</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cuh_source.html#l01929">Nodes.cuh:1929</a></div></div>
<div class="ttc" id="aclassnz_1_1nodes_1_1calc_1_1_reshape_node_html"><div class="ttname"><a href="classnz_1_1nodes_1_1calc_1_1_reshape_node.html">nz::nodes::calc::ReshapeNode</a></div><div class="ttdoc">Implements tensor shape transformation within a neural network computational graph.</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cuh_source.html#l03344">Nodes.cuh:3344</a></div></div>
<div class="ttc" id="aclassnz_1_1nodes_1_1calc_1_1_sigmoid_node_html"><div class="ttname"><a href="classnz_1_1nodes_1_1calc_1_1_sigmoid_node.html">nz::nodes::calc::SigmoidNode</a></div><div class="ttdoc">Represents a Sigmoid activation function node in a computational graph.</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cuh_source.html#l02072">Nodes.cuh:2072</a></div></div>
<div class="ttc" id="aclassnz_1_1nodes_1_1calc_1_1_softmax_node_html"><div class="ttname"><a href="classnz_1_1nodes_1_1calc_1_1_softmax_node.html">nz::nodes::calc::SoftmaxNode</a></div><div class="ttdoc">Implements the Softmax activation function as a node in a neural network computational graph.</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cuh_source.html#l03152">Nodes.cuh:3152</a></div></div>
<div class="ttc" id="aclassnz_1_1nodes_1_1calc_1_1_sub_node_html"><div class="ttname"><a href="classnz_1_1nodes_1_1calc_1_1_sub_node.html">nz::nodes::calc::SubNode</a></div><div class="ttdoc">Represents a subtraction operation node in a computational graph.</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cuh_source.html#l01787">Nodes.cuh:1787</a></div></div>
<div class="ttc" id="aclassnz_1_1nodes_1_1calc_1_1_swish_node_html"><div class="ttname"><a href="classnz_1_1nodes_1_1calc_1_1_swish_node.html">nz::nodes::calc::SwishNode</a></div><div class="ttdoc">Represents a Swish activation function node in a computational graph.</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cuh_source.html#l02504">Nodes.cuh:2504</a></div></div>
<div class="ttc" id="aclassnz_1_1nodes_1_1calc_1_1_tanh_node_html"><div class="ttname"><a href="classnz_1_1nodes_1_1calc_1_1_tanh_node.html">nz::nodes::calc::TanhNode</a></div><div class="ttdoc">Represents a hyperbolic tangent (tanh) activation function node in a computational graph.</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cuh_source.html#l02214">Nodes.cuh:2214</a></div></div>
<div class="ttc" id="aclassnz_1_1nodes_1_1io_1_1_input_node_html"><div class="ttname"><a href="classnz_1_1nodes_1_1io_1_1_input_node.html">nz::nodes::io::InputNode</a></div><div class="ttdoc">Represents an input node in a computational graph.</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cuh_source.html#l00437">Nodes.cuh:437</a></div></div>
<div class="ttc" id="aclassnz_1_1nodes_1_1io_1_1_output_node_html"><div class="ttname"><a href="classnz_1_1nodes_1_1io_1_1_output_node.html">nz::nodes::io::OutputNode</a></div><div class="ttdoc">Base class for loss function nodes in a computational graph.</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cuh_source.html#l00683">Nodes.cuh:683</a></div></div>
<div class="ttc" id="aclassnz_1_1nodes_1_1loss_1_1_binary_cross_entropy_node_html"><div class="ttname"><a href="classnz_1_1nodes_1_1loss_1_1_binary_cross_entropy_node.html">nz::nodes::loss::BinaryCrossEntropyNode</a></div><div class="ttdoc">Represents the Binary Cross-Entropy (BCE) loss function node in a computational graph.</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cuh_source.html#l04958">Nodes.cuh:4958</a></div></div>
<div class="ttc" id="aclassnz_1_1nodes_1_1loss_1_1_mean_squared_error_node_html"><div class="ttname"><a href="classnz_1_1nodes_1_1loss_1_1_mean_squared_error_node.html">nz::nodes::loss::MeanSquaredErrorNode</a></div><div class="ttdoc">Represents the Mean Squared Error (MSE) loss function node in a computational graph.</div><div class="ttdef"><b>Definition</b> <a href="_nodes_8cuh_source.html#l04804">Nodes.cuh:4804</a></div></div>
<div class="ttc" id="aclassnz_1_1opt_1_1_optimizer_html"><div class="ttname"><a href="classnz_1_1opt_1_1_optimizer.html">nz::opt::Optimizer</a></div><div class="ttdoc">Base class for optimization algorithms in deep learning.</div><div class="ttdef"><b>Definition</b> <a href="_optimizer_8cuh_source.html#l00125">Optimizer.cuh:125</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
